package com.xplusplus.security.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

/**
 * @Author: zhouweixin
 * @Description: 临时项目明细
 * @Date: Created in 14:28 2018/9/3
 * @Modified By:
 */
@Entity
@ApiModel(value = "临时项目明细")
public class TemporaryProjectDetail {
    @Id
    @ApiModelProperty(value = "主键：自增长")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(targetEntity = TemporaryProjectHeader.class)
    @JoinColumn(name = "header_id", referencedColumnName = "id")
    private TemporaryProjectHeader header;

    @ApiModelProperty(value = "天数")
    private Integer days = 0;

    @ApiModelProperty(value = "基本补助")
    private Double unitWage = 0.0;

    @ApiModelProperty(value = "合计")
    private Double sumWage = 0.0;

    @ManyToOne(targetEntity = User.class)
    @JoinColumn(name = "user_id", referencedColumnName = "id")
    @ApiModelProperty(value = "员工")
    private User user;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @JsonIgnore
    public TemporaryProjectHeader getHeader() {
        return header;
    }

    public void setHeader(TemporaryProjectHeader header) {
        this.header = header;
    }

    public Integer getDays() {
        return days;
    }

    public void setDays(Integer days) {
        this.days = days;
    }

    public Double getUnitWage() {
        return unitWage;
    }

    public void setUnitWage(Double unitWage) {
        this.unitWage = unitWage;
    }

    public Double getSumWage() {
        return sumWage;
    }

    public void setSumWage(Double sumWage) {
        this.sumWage = sumWage;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
